CreditNowDemo is a skeleton for an OpenDoc™ part. It was generated by PartMaker. The part has been updated to OpenDoc for Developer Release 2, and uses one source file for each of the OpenDoc™ protocols. Some default functionality has been added:
A “Make” file for 68K, using MPW (Macintosh Programmers Workshop) has also been added. It uses Symantec C++ for MPW and the CFM-68K additions for MPW. The “MPW Demo” folder on the Developer Release contains all the required tools to build for 68K.
Alternatively, you can check out the “CreditNowDemo Classic”. That part has been updated to OpenDoc for Developer Release 2, and is meant as a reference for developers who have already used PartMaker to start with OpenDoc development. You can compare the generated source with the result generated by PartMaker on Developer Release 1.
For Users of PartMaker on Developer Release 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These are the major changes of the source code generated by PartMaker compared to the source code compared by the Hello Part Classic document. If this is the first time you use OpenDoc™ or PartMaker, this set of source code is now the preferred method.
- The structure of the project uses one source file per OpenDoc™ protocol. Hopefully this makes determining what sources you have to change easier.
- All non-OpenDoc methods are now called Priv...(). This stands for private method. It is a method that is not called by OpenDoc™, but a method that was added to the CPCreditNowDemo class. For instance, the Internalize() and Externalize() methods now dispatch to helper methods.
- If you hold the Control and Option keys down, you will get a DebugStr() whenever an OpenDoc™ method has been added. You can toggle of theis behavior by setting the variable qTraceEnteringMethods to 0 in CPCreditNowDemo.h.
- A file “CPCreditNowDemo.Doc.cpp” contains the documentation that used to be in the source files. After you compile the project once, you can use Cmd-Click in CodeWarrior or use the “Search:Find Definition” menu option to go to this documentation. This file is part of the CodeWarrior project, but you can remove it if you like.
- A 68K Make file has been added.
- Support for drawing a part as icon or thumbnail has been added.
- Support for dropping in text has been added. You can drag some text or a file on top of CreditNowDemo. The string displayed will update to the new text (well, the first 255 characters of it).
- Added support for BNDL's (custom icons for editors and documents). Look in the file “CreditNowDemoDef.h” for some information on what you need to do for your part.
Building with CodeWarrior for PowerPC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Launch the MetroWerks CodeWarrior 5.5 project and issue Command-M or select Project:Make.
If you need to regenerate resources of CreditNowDemo, an MPW Make file has been provided to do this. Note that the generated PartMaker folder has “precompiled” resources and SOM™ header files.
To build Resources for CreditNowDemo PowerPC version:
Open “:$Resources:CreditNowDemo.Make.rsrc”, select all and execute.
To build SOM header for CreditNowDemo PowerPC version:
Open “:$SOM:Qwerty.Make.x[i]h”, select all and execute.
Building with MPW for 68K
~~~~~~~~~~~~~~~~~~~~~
Execute these commands in your MPW Worksheet:
# go to the folder of your generated PartMaker OpenDoc part
Directory "<fill in the path>:CreditNowDemo:"
# do a make, the -e indicates a full make
Make -e -f CreditNowDemo.68K.Make BUILDILINK
This will generate a number of SCpp compiler, ILink linker and Rez resource compiler commands. Select them all and execute them in MPW (hit Enter).
Notes
~~~~
The MPW build systems for 68K and PowerPC will be integrated in a future release.